function curry(fn){
    const argsLength =  fn.length;
    let curried = (...args)=>{
       if(args.length < argsLength){
          return (...rest)=>curried(...args,...rest)
       } 
       return fn(...args)
    }
    return curried;
}
function add(a,b,c){
    return a+b+c;
}
const f = curry(add)
const r1 = f(1)
const r2 = r1(2,3)
console.log(r1,r2)